#ifndef _GEOMBOX_
#define _GEOMBOX_

#include "GeomObject.h"

// doesnt contain rotation
class GeomBox: public GeomObject{
protected:
	Vec3d mSide;
public:
	// Constructor
	GeomBox(Vec3d _dim) : mSide(_dim){
		mType=BOX;
	}
	
	bool isInside(Vec3d _pt){
		Vec3d _localPt = xform(getInvWorldTransform(), _pt);
		return (fabs(_pt[0])<mSide[0]/2) && (fabs(_pt[1])<mSide[1]/2) && (fabs(_pt[2])<mSide[2]/2);
	}
	// Get signed distance to inPoint
	inline double getSignedDist(const Vec3d &inPoint){
		printf("Error in line %d in file %s: Not Yet Implemented!\n", __LINE__, __FILE__);
		return 0;
	}

	double getVolume(){
		return mSide[0]*mSide[1]*mSide[2];	//	a*b*c
	}
	void setExtent(Vec3d _d){mSide=_d;}
	void draw(Vec4d _col=Vec4d(vl_1), bool _default=true);

	inline Vec3d getSides(){ return mSide; }
	GeomObject* getObjApplyInvTransform(const Mat4d &_mat){
		printf("Error in line %d in file %s: Not Yet Implemented!\n", __LINE__, __FILE__);
		return NULL;
	}

};

#endif
